package gov.fgn.sijyp.integracion.origen;

import java.io.Serializable;

import javax.persistence.*;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * The persistent class for the relacionfiscaldespachoversion database
 * table.
 */
@Entity
@Table(name = "relaciondespachofiscal", schema = "siijyp_integracion")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@AssociationOverrides({
                       @AssociationOverride(name = "id.autoridad", joinColumns = @JoinColumn(name = "iddespacho")),
                       @AssociationOverride(name = "id.fiscal", joinColumns = @JoinColumn(name = "idfiscal")) })
public class RelacionDespachoFiscal implements Serializable {
  private static final long serialVersionUID = 1L;

  @EmbeddedId
  private RelacionDespachoFiscalPK id = new RelacionDespachoFiscalPK();

  @Column(length = 15)
  private String ip;

  @Column(nullable = false, length = 10)
  private String usuario;

  public RelacionDespachoFiscal() {
  }

  public RelacionDespachoFiscalPK getId() {
    return this.id;
  }

  public void setId(RelacionDespachoFiscalPK id) {
    this.id = id;
  }

  public String getIp() {
    return this.ip;
  }

  public void setIp(String ip) {
    this.ip = ip;
  }

  public String getUsuario() {
    return this.usuario;
  }

  public void setUsuario(String usuario) {
    this.usuario = usuario;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null || getClass() != obj.getClass())
      return false;

    RelacionDespachoFiscal castObj = (RelacionDespachoFiscal) obj;

    if (getId() != null ? !getId().equals(castObj.getId()) : castObj.getId() != null)
      return false;

    return true;
  }

  public int hashCode() {
    return (getId() != null ? getId().hashCode() : 0);
  }
}